class Person:
    pass


class Student(Person):
    pass


class Teacher(Person):
    pass


class Worker(Person):
    pass


class PersonFactory:
    def get_person(self, p_type) -> Person:
        if p_type == "w":
            return Worker()

        if p_type == "t":
            return Teacher()
        else:
            return Student()


person = PersonFactory().get_person("w")

print(type(person))
